package com.zzuli.practice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;

@Data
public class Repairman {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private String age;

    private String phone;

    private String sex;

    private Integer status;

    @TableField(exist = false)
    private String statusName;

    // 逻辑删除
    @TableLogic
    private Integer deletetype;

    public String getStatusName(){
        switch (status){
            case 0:
                this.statusName = "空闲";
                break;
            case 1:
                this.statusName = "忙碌";
                break;
        }
        return this.statusName;
    }

}
